<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{$meta_title}</title>
  
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="">
  <link rel="apple-touch-icon-precomposed" href="">
  <meta name="apple-mobile-web-app-title" content="{$meta_title}" />
  <link rel="stylesheet" href="__ROOT__/Application/Home/View/default/assets/css/amazeui.min.css"/>
  <link rel="stylesheet" href="__ROOT__/Application/Home/View/default/assets/css/admin.css">
  
 
 <script type="text/javascript" src="__PUBLIC__/libs/dingding/javascripts/zepto.min.js"></script>
  <script type="text/javascript" src="https://g.alicdn.com/ilw/ding/0.8.9/scripts/dingtalk.js"></script>

</head>
<body>

<div class="am-cf admin-main">
  

<!-- content start -->
<div class="admin-content">
  <div class="admin-content-body">
   <div style="height:10px;"></div>
      
<form class="am-form" id="serverform" action="{:U('Wap/Server/editserver')}" method="post">

			          
	          <div class="am-g am-margin-top">
              <div class="am-u-sm-3 am-u-md-2 am-text-right">
                服务器名称
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="server_name" value="{$info.server_name}">
                <input type="hidden"  name="id" value="{$info.id}">
              </div>
            </div>  
            
            <div class="am-g am-margin-top">
              <div class="am-u-sm-3 am-u-md-2 am-text-right">
                服务器IP
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="ip" value="{$info.ip}">
              </div>
            </div>  
            
            <div class="am-g am-margin-top">
	            <div class="am-u-sm-3 am-u-md-2 am-text-right">服务器位置</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">
	              <select name="place" id="">
	              	<volist name="place" id="vo" >
	                <option value="{$key}" <if condition="$key eq $info.place " >selected = "selected"</if> >{$vo}</option>
	                </volist>
	              </select>
	            </div>
	          </div>  
	          
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-3 am-u-md-2 am-text-right">操作系统</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">
	              <select name="system" id="">
	              	<volist name="system" id="vo" key="k">
	                <option value="{$vo.id}" <if condition="$vo.id eq $info.system " >selected = "selected"</if>>{$vo.title}</option>
	                </volist>
	              </select>
	            </div>
	          </div>  
	          
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-3 am-u-md-2 am-text-right">供应商</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">
	              <select name="supplier" id="">
	              	<volist name="supplier" id="vo" key="k">
	                <option value="{$vo.id}" <if condition="$vo.id eq $info.supplier " >selected = "selected"</if>>{$vo.title}</option>
	                </volist>
	              </select>
	            </div>
	          </div>  
	          
	           <div class="am-g am-margin-top">
              <div class="am-u-sm-3 am-u-md-2 am-text-right">
                开通时间
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
	              <div class="am-input-group am-input-group-sm">
		            <input type="text" class="am-form-field" id="s_time"  name="s_time"  value="{$info.s_time|date='Y-m-d H:m',###}">
		          	<span class="am-input-group-btn">
		            	<button class="am-btn am-btn-default" type="button" id="stime">选择</button>
		          	</span>
		          </div>
               
              </div>
            </div>  
	          
	          <div class="am-g am-margin-top">
              <div class="am-u-sm-3 am-u-md-2 am-text-right">
                过期时间
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
              	  <div class="am-input-group am-input-group-sm">
		            <input type="text" class="am-form-field" id="e_time"  name="e_time"  value="{$info.e_time|date='Y-m-d H:m',###}">
		          	<span class="am-input-group-btn">
		            	<button class="am-btn am-btn-default" type="button" id="etime">选择</button>
		          	</span>
		          </div>
                
              </div>
            </div> 
	          
	                 
          <div class="am-g am-margin-top">
              <div class="am-u-sm-3 am-u-md-2 am-text-right">
                续费价格
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="price" value="{$info.price}">
              </div>
            </div>  
            
            <div class="am-g am-margin-top">
              <div class="am-u-sm-3 am-u-md-2 am-text-right">
                市场价格
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="yprice" value="{$info.yprice}">
              </div>
            </div>  
             
             <div class="am-g am-margin-top">
             <div class="am-u-sm-3 am-u-md-2 am-text-right">搜索客户</div>
             <div class="am-u-sm-8 am-u-md-4 am-u-end" >
	          <div class="am-input-group am-input-group-sm">
	            <input type="text" class="am-form-field" id="so_customer" placeholder="请输入客户名/编号/手机号">
	          <span class="am-input-group-btn">
	            <button class="am-btn am-btn-default" type="button" id="search">搜索</button>
	          </span>
	          </div>
	        </div>
             </div>
             
			  <div class="am-g am-margin-top">
	            <div class="am-u-sm-3 am-u-md-2 am-text-right">所属客户</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">
	              <select name="customer_id" id="customer_id">
	              	<volist name="cuss" id="vo" >
	                <option value="{$key}" <if condition="$key eq $info.customer_id " >selected = "selected"</if>>{$vo}</option>
	                </volist>
	              </select>
	            </div>
	          </div>

            
            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                服务器远程账号
              </div>
              <div class="am-u-sm-12 am-u-md-6 am-u-end">
                <textarea rows="4" name="account" placeholder="请填写服务器远程账号">{$info.account}</textarea>
              </div>
            </div>
            
            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                配置信息
              </div>
              <div class="am-u-sm-12 am-u-md-6 am-u-end">
                <textarea rows="4" name="info" placeholder="请填写配置信息">{$info.info}</textarea>
              </div>
            </div>
            
            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                备注
              </div>
              <div class="am-u-sm-12 am-u-md-6 am-u-end">
                <textarea rows="4" name="remark" placeholder="请填写备注">{$info.remark}</textarea>
              </div>
            </div>

          </form>
   
	<div class="am-margin">
      <button type="button" class="am-btn am-btn-primary am-btn-xs" id="saveserver">提交保存</button>
      <button type="button" class="am-btn am-btn-primary am-btn-xs" onClick="javascript :history.back(-1);">放弃保存</button>
    </div>
<div style="height:80px;"></div>
  </div>
</div>
<!-- content end -->

</div>

<script type="text/javascript" >

dd.ready(function() {
	//禁用下拉刷新
	dd.ui.pullToRefresh.disable();
	//右侧
	dd.biz.navigation.setRight({
	    show: false,//控制按钮显示， true 显示， false 隐藏， 默认true
	    control: false,//是否控制点击事件，true 控制，false 不控制， 默认false
	    text: '',//控制显示文本，空字符串表示显示默认文本
	    onSuccess : function(result) {
	    	
	        //如果control为true，则onSuccess将在发生按钮点击事件被回调
	        /*
	        {}
	        */
	    },
	    onFail : function(err) {}
	});

}); 

//搜索项目
$('#search').click(function(){
	var keyword=$('#so_customer').val();
	var params = {};
	params.keyword=keyword;
	
	var url="{:U('Home/Server/getCustomerAjax')}";
	$.post(url,params,function(data) {
		
			$('#customer_id').html(data);
		
	});
});

//开始日期
var stime="{$info.s_time|date='Y-m-d H:m',###}";
$('#stime').click(function(){
	dd.biz.util.datetimepicker({
	    format: 'yyyy-MM-dd HH:mm',
	    value: '', //默认显示
	    onSuccess : function(result) {
	        //onSuccess将在点击完成之后回调
	        $('#s_time').val(result.value);
	        /*{
	            value: "2015-06-10 09:50"
	        }
	        */
	    },
	    onFail : function() {}
	});
});
//到期日期
var etime="{$info.e_time|date='Y-m-d H:m',###}";
$('#etime').click(function(){
	dd.biz.util.datetimepicker({
	    format: 'yyyy-MM-dd HH:mm',
	    value: etime, //默认显示
	    onSuccess : function(result) {
	        //onSuccess将在点击完成之后回调
	        $('#e_time').val(result.value);
	        /*{
	            value: "2015-06-10 09:50"
	        }
	        */
	    },
	    onFail : function() {}
	});
});

//提交表单
	$('#saveserver').click(function(){
	 	$('#serverform').submit();
	});
</script>
<!-- footnav start --> 
<style>
.footnav{ position: fixed;  bottom: 0;    width: 100% ; background: #fff; z-index:999999}
.footnav ul{ padding:5px 0; border-top:1px solid #ccc}
.footnav ul li{ width:20%; float:left;list-style-type: none;}
.footnav ul li a{ display:block; text-align:center; font-size:12px;    color: #767171;}
.footnav ul li a span{ font-size:24px;line-height: 20px;}
.active a {color:#0e90d2 !important;}

</style>
<div class=" footnav">
    <ul>
    <li > <a  href="/Wap/Index/shouye" ><span class="am-icon-home"></span>首页 </a> </li>
     <li ><a href="/Wap/Task/mytask"><span class="am-icon-file-text"></span>任务</a></li>
      <li class="active"><a href="/Wap/Server/index"><span class="am-icon-recycle"></span> 服务器</a></li>
      <li ><a href="/Wap/Customer/index"><span class="am-icon-user-md"></span>客户</a></li> 
      <li ><a href="/Wap/Project/index"><span class="am-icon-briefcase"></span>项目</a></li>
    </ul>
    
</div>
<!-- footnav end -->
<script src="__ROOT__/Application/Home/View/default/assets/js/jquery.min.js"></script>

<script src="__ROOT__/Application/Home/View/default/assets/js/amazeui.min.js"></script>
<script src="__ROOT__/Application/Home/View/default/assets/js/app.js"></script>
</body>
</html>
